package com.whmskj.xjlhsc.mobie.empProPlan.controller;

import com.whmskj.xjlhsc.mobie.empProPlan.entity.ProPersonnelStandConfirm;
import com.whmskj.xjlhsc.mobie.empProPlan.service.ProPersonnelStandConfirmService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.GetMapping;
import java.util.List;

/**
 * 人员看台组长确认临时表
 *
 * @author lk
 * @since 2025-07-07 11:01:25
 */
@RestController
@RequestMapping("/proPersonnelStandConfirm")
public class ProPersonnelStandConfirmController {

    @Autowired
    private ProPersonnelStandConfirmService proPersonnelStandConfirmService;

    /**
     * 分页查询
     *
     * @param params
     * @return
     */
    @PostMapping("/findPage")
    public ResponseEntity<Page<ProPersonnelStandConfirm>> findPage(@RequestBody ProPersonnelStandConfirm params) {
        Page<ProPersonnelStandConfirm> result = proPersonnelStandConfirmService.findPage(params);
        return ResponseEntity.ok(result);
    }
    /**
     * 列表查询
     *
     * @param params
     * @return
     */
    @PostMapping("/findList")
    public ResponseEntity<List<ProPersonnelStandConfirm>> findList(@RequestBody ProPersonnelStandConfirm params) {
        List<ProPersonnelStandConfirm> result = proPersonnelStandConfirmService.findList(params);
        return ResponseEntity.ok(result);
    }

    /**
     * 查询
     *
     * @param id
     * @return
     */
    @GetMapping("/{id}")
    public ResponseEntity<ProPersonnelStandConfirm> findById(@PathVariable("id") Long id) {
        ProPersonnelStandConfirm proPersonnelStandConfirm = proPersonnelStandConfirmService.findById(id);
        return ResponseEntity.ok(proPersonnelStandConfirm);
    }

    /**
     * 新增
     *
     * @param proPersonnelStandConfirm
     * @return
     */
    @PostMapping
    public ResponseEntity<Boolean> insert( @RequestBody ProPersonnelStandConfirm proPersonnelStandConfirm) {
        boolean result = proPersonnelStandConfirmService.insert(proPersonnelStandConfirm);
        return ResponseEntity.ok(result);
    }

    /**
     * 修改
     *
     * @param proPersonnelStandConfirm
     * @return
     */
    @PutMapping
    public ResponseEntity<Boolean> update( @RequestBody ProPersonnelStandConfirm proPersonnelStandConfirm) {
        boolean result = proPersonnelStandConfirmService.update(proPersonnelStandConfirm);
        return ResponseEntity.ok(result);
    }

    /**
     * 删除
     *
     * @param id
     * @return
     */
    @DeleteMapping("/{id}")
    public ResponseEntity<Integer> delete(@PathVariable("id") Long id) {
        int result = proPersonnelStandConfirmService.delete(id);
        return ResponseEntity.ok(result);
    }

}